import { EntitySchema } from '@mikro-orm/core';

export class TypechoInbox {
  id!: number;
  type?: string;
  uid?: number = 0;
  text?: string;
  touid: number = 0;
  isread?: number = 0;
  value?: number = 0;
  created?: number = 0;
}

export const TypechoInboxSchema = new EntitySchema({
  class: TypechoInbox,
  properties: {
    id: { primary: true, type: 'number' },
    type: { type: 'string', length: 255, nullable: true },
    uid: { type: 'number', nullable: true, default: 0 },
    text: { type: 'string', columnType: 'text', nullable: true },
    touid: { type: 'number', default: 0 },
    isread: { type: 'number', nullable: true, default: 0 },
    value: { type: 'number', nullable: true, default: 0 },
    created: { type: 'number', nullable: true, default: 0 },
  },
});
